<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<link rel="stylesheet" href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.excheck-3.5.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	  // 在这里写你的代码...
	  $("#ok_btn").click(function(){
		  if($("#template").val() ==""){
			  $("#isUpToStandard").focus();
				top.$.jBox.tip('请选择合同模板', 'warning');
				return;
		  }else{
			  var templateId =$("#template").val();
			  var intentId = $("#id").val();
			  var navId = $("#navId").val();
			  var intentType = $("#intent_type").val();
			  $("#form").attr('action','${contextPath}/biz/intent/common/'+templateId+'/'+intentId+'/createText?navId='+navId+'&intentType='+intentType).submit();
			  $("#ok_btn").attr("data-dismiss","modal");
		  }
	  });
});
</script>
<div class="modal-dialog">
	<div class="modal-content">
		<!-- /modal-header -->
		<div class="modal-body">
			<table class="table">
				<tr>
					<td>
						<div class="col-sm-12">
							<label for="brandAttribute_lab" class="col-sm-5 control-label">合同文本模板</label>
							<form action="" id="form" method="post">
							<div class="col-sm-8">
	                       		<select class="f_5" id="template">
	                       			<option value="">---请选择---</option>
	                       			<c:forEach items="${templateList}" var="template" varStatus="i">
	                       				<option value="${template.id}">${template.templateName}</option>
	                       			</c:forEach>
	                       		</select>
	                      </div>
						</div>
					</td>
				</tr>
			</table>

		</div>
		<!-- /modal-body -->
		<div class="modal-footer">
			<button type="button" id="ok_btn" 
				class="btn btn-primary">确定</button>
			<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
		</div>
		<!-- /modal-footer -->
	</div>
</div>
<script type="text/javascript">
	$('.o-a-form-datetime').datetimepicker({
        language:  'zh-CN',
        weekStart: 1,
        todayBtn:  1,
		autoclose: 1,
		todayHighlight: 1,
		startView: 2,
		minView: 2,
		forceParse: 0,
		format: 'yyyy-mm-dd'
    });

</script>
</body>
<script type="text/javascript" src="${staticPath}/js/list.js"></script>